<?php require_once(dirname(__FILE__).'/../include/config.inc.php');
require_once "function.php";
//初始化参数检测正确性
$cid = empty($cid) ? 16 : intval($cid);


?>

<!DOCTYPE html>

<html>

<head>

<title><?php echo $cfg_webname;?> 技术知识库</title>

<meta charset="utf-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

<link rel="stylesheet" href="lib/weui.min.css">

<link rel="stylesheet" href="css/jquery-weui.css">

<link rel="stylesheet" href="css/font-awesome.min.css">

<link rel="stylesheet" href="css/demos.css">

</head>

<body ontouchstart>

<div class="top"> <img src="images/faq.jpg" width="100%"> </div>

<!-- 搜索-->

<div class="weui-search-bar" id="searchBar">

  <form class="weui-search-bar__form">

    <div class="weui-search-bar__box"> <i class="weui-icon-search"></i>

      <input type="search" class="weui-search-bar__input" id="searchInput" placeholder="搜索" required id="keyword" name="keyword">

      <a href="javascript:" class="weui-icon-clear" id="searchClear"></a> </div>

    <label class="weui-search-bar__label" id="searchText" style="transform-origin: 0px 0px 0px; opacity: 1; transform: scale(1, 1);"> <i class="weui-icon-search"></i> <span>搜索</span> </label>

  </form>

  <a href="javascript:" class="weui-search-bar__cancel-btn" id="searchCancel">取消</a> </div>

<!--/ 搜索-->

<div class="weui-panel weui-panel_access">

  <div class="weui-panel__hd">知识库</div>

  <div class="weui-panel__bd"> 

				<?php

				if(isset($keyword)){

					$keyword=htmlspecialchars($keyword);

					$dopage->GetPage("SELECT * FROM `#@__infolist` WHERE (classid=$cid OR parentstr LIKE '%,$cid,%') AND title like '%$keyword%' AND delstate='' AND checkinfo=true ORDER BY orderid DESC",8);

				}else{

					$dopage->GetPage("SELECT * FROM `#@__infolist` WHERE (classid=$cid OR parentstr LIKE '%,$cid,%') AND delstate='' AND checkinfo=true ORDER BY orderid DESC",8);

				}

				while($row = $dosql->GetArray())

				{

					if($row['linkurl']=='' and $cfg_isreurl!='Y') $gourl = 'newsshow.php?cid='.$row['classid'].'&id='.$row['id'];

					else if($cfg_isreurl=='Y') $gourl = 'newsshow-'.$row['classid'].'-'.$row['id'].'-1.html';

					else $gourl = $row['linkurl'];



					$row2 = $dosql->GetOne("SELECT `classname` FROM `#@__infoclass` WHERE `id`=".$row['classid']);

					if($cfg_isreurl!='Y') $gourl2 = 'news.php?cid='.$row['classid'];

					else $gourl2 = 'news-'.$row['classid'].'-1.html';

					

					if($row['picurl']!=''){

						 $picurl = "/".$row['picurl'];

					}else{

						 $picurl = 'images/advancedsettings.png';

					}

					

				?>

  <a href="<?php echo $gourl; ?>" class="weui-media-box weui-media-box_appmsg">

    <div class="weui-media-box__hd"> <img class="weui-media-box__thumb" src="<?php echo $picurl;?>" alt=""> </div>

    <div class="weui-media-box__bd">

      <h4 class="weui-media-box__title"  style="color:<?php echo $row['colorval']; ?>"><?php echo $row['title']; ?></h4>

      <p class="weui-media-box__desc"><?php echo $row['description']; ?></p>

    </div>

    </a> 

			<?php

				}

				?>

         </div>

		<div class="page-div">

        <?php echo $dopage->GetList(); ?>

        </div>

</div>

<div class="clear"></div>

<script src="lib/jquery-2.1.4.js"></script> 

<script src="lib/fastclick.js"></script> 

<script>

  $(function() {

    FastClick.attach(document.body);

  });

</script> 

<script src="js/jquery-weui.js"></script> 

<script src="js/city-picker.js"></script>

<div class="sub_btn"></div>
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script>
  /*
   * 注意：
   * 1. 所有的JS接口只能在公众号绑定的域名下调用，公众号开发者需要先登录微信公众平台进入"公众号设置"的"功能设置"里填写"JS接口安全域名"。
   * 2. 如果发现在 Android 不能分享自定义内容，请到官网下载最新的包覆盖安装，Android 自定义分享接口需升级至 6.0.2.58 版本及以上。
   * 3. 常见问题及完整 JS-SDK 文档地址：http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html
   *
   * 开发中遇到问题详见文档"附录5-常见错误及解决办法"解决，如仍未能解决可通过以下渠道反馈：
   * 邮箱地址：weixin-open@qq.com
   * 邮件主题：【微信JS-SDK反馈】具体问题
   * 邮件内容说明：用简明的语言描述问题所在，并交代清楚遇到该问题的场景，可附上截屏图片，微信团队会尽快处理你的反馈。
   */
  wx.config({
    debug: false,
    appId: '<?php echo $signPackage["appId"];?>',
    timestamp: <?php echo $signPackage["timestamp"];?>,
    nonceStr: '<?php echo $signPackage["nonceStr"];?>',
    signature: '<?php echo $signPackage["signature"];?>',
    jsApiList: [
      // 所有要调用的 API 都要加到这个列表中
	    'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
		'openAddress',
		'chooseImage',
		'previewImage',
		'uploadImage',
		'downloadImage',
		'scanQRCode'
    ]
  });
  wx.ready(function () {
	  // 分享
	  var urlurl=window.location.href;
	  var shareData = {
    	   title: '技术知识库-翰之博售后服务',
    	   desc: '<?php echo $cfg_webname;?>知识库。在线报修，2小时内响应。48-72小时内完修',
           link: urlurl,
           imgUrl: 'https://www.hanzhibo.cn/wx/images/yitiji.jpg'
	  };
	  
	  
	  wx.onMenuShareAppMessage(shareData);
	  wx.onMenuShareTimeline(shareData);
	  wx.onMenuShareQQ(shareData);
	  wx.onMenuShareQZone(shareData);
	  

	  
	  
  })
</script>    
<?php require_once('footer.php'); ?>